home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / EleOfC++ vrs 0.1 / PictView / TApp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-14  |  2.7 KB  |  118 lines  |  [TEXT/KAHL]

  1. /*
  2. ** This is the TApp class declaration.  This class is an adaptation of 
  3. ** the class of the same name in the book, Elements of C++ Macintosh 
  4. ** Programming, by Dan Weston.
  5. **
  6. ** Copyright © 1991 Mark Gross 
  7. ** (RR2, Box 84, Clayville, NY 13322);         
  8. ** this file may be published everywhere, but no charge
  9. ** may be made for its use.  Please contact me about any bugs found.
  10. ** I'm also looking for Macintosh development work, so drop me a line
  11. ** if you think I could help.  
  12. **    
  13. */
  14.  
  15.  
  16. #define _H_TApp
  17. #include "TDoc.h"
  18. #include "TList.h"
  19. #include "TIterator.h"
  20.  
  21.  
  22.  
  23. struct    TApp:indirect
  24. {
  25.     SysEnvRec        fenvRec;
  26.     TList            *fDocList;
  27.     TDoc            *fCurDoc;
  28.     Boolean            fHaveWaitNextEvent;
  29.     Boolean            fDone;
  30.     Boolean            fInBackground;
  31.     Handle            fClipData;
  32.     OSType            fClipType;
  33.     SFTypeList        fFileTypeList;
  34.     Boolean            fDAonTop;
  35.     short            fLastScrapCount;
  36.     
  37.     
  38. /*
  39. ** member fumctions follow
  40. */
  41.  
  42. /*    clipboard support        */
  43.     OSType    CanAcceptClipType(void);
  44.     void    GetClipFromSystem(void);
  45.     void    GiveClipToSystem(void);
  46.     Boolean    ClipHasChanged(void);
  47.     void    CheckForDASwitch(WindowPtr theFrontWindow);
  48.     
  49. /*    constructor and destructor        */
  50.     TApp*    Init(void);
  51.     Boolean    TrapAvailable(void);
  52.     void    Delete(void);
  53.     
  54. /*    initializing the application    */
  55.     Boolean    InitApp(void);
  56.  
  57. /*cleaning up after the application    */
  58.     void    CleanUp(void);
  59.  
  60. /*    making documents            */
  61.     TDoc*    MakeDoc(SFReply *reply);
  62.     OSType    GetCreator(void);
  63.     void    AddDocument(TDoc *theDoc);
  64.     
  65. /*    opening new documents        */
  66.     void    OpenNewDoc(void);
  67.  
  68. /*    opening old documents        */
  69.     int    GetNumFileTypes(void);
  70.     void    GetFileTypeList(void);
  71.     void    OpenOldDoc(void);
  72.     Boolean    InitOldDoc(SFReply *reply);
  73.     
  74. /*    opening documents form finder    */
  75.     Boolean    OpenDocFromFinder(void);
  76.     Boolean    AcceptableFileType(OSType theType);
  77.  
  78. /*    deleting documents        */
  79.     Boolean CloseADoc(TDoc    *theDoc);
  80.     
  81. /*    handling events        */
  82.     void    EventLoop(void);
  83.     
  84.     void    AppIdle(void);
  85.     void    DiskEvt(EventRecord    *theEvent);
  86.  
  87.     void    MouseUp(EventRecord    *theEvent);
  88.     void    MouseDown(EventRecord    *theEvent);
  89.     void    KeyDown(EventRecord *theEvent);
  90.     void    ActivateEvt(EventRecord *theEvent);
  91.     void    UpdateEvt(EventRecord *theEvent);
  92.     
  93. /*    Multifinder support        */
  94.     void    OSEvent(EventRecord *theEvent);
  95.     
  96.     void    DoSuspend(EventRecord *theEvent, Boolean convertClip);
  97.     void    DoResume(EventRecord *theEvent, Boolean convertClip);
  98.     
  99. /*    handling menus            */
  100.     void    SetMenuAbility(MenuHandle menu, short item, Boolean enable);
  101.  
  102.     void    AdjustMenus(void);
  103.     Boolean     CanOpen(void);
  104.  
  105.     void    DoMenuCommand(short menuID, short menuItem);
  106.     
  107.     void    Quit(void);
  108.     void    ExitLoop(void);
  109.  
  110.     void    DoUndoCmd(TDoc *theDoc);
  111.     void    DoPasteCmd(TDoc *theDoc);
  112.     void    DoCutCmd(TDoc *theDoc);
  113.     void    DoCopyCmd(TDoc *theDoc);
  114.     
  115.     
  116. };/*end of class definition of TDoc class*/
  117.  
  118.